Skip to content

Clear up several issues around WebAssembly.Function usage #33

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tsyesika
Copy link

@tsyesika tsyesika commented Jul 7, 2021

This clears up two issues in the overview document surrounding the usage of WebAssembly.Function, these are:

  • What behaviour should occur if you pass a WebAssembly.Function object to the WebAssembly.Function constructor. (discussed here: Passing a WasmExportedFunction to new WebAssembly.Function #13)
  • Clarify that the same behaviour should occur when calling the function as when calling an exported function (e.g. the ToJSValue should be applied to arguments when called, etc.)

@@ -145,6 +145,8 @@ This part of the proposal refines Wasm exported functions to have a suitable sub

* The constructor for this class can be used to explicitly construct Wasm exported functions, closing a gap in the current API in that does not provide a way for JavaScript to put a plain JS function into a table (while the same is possible from inside Wasm).

* The constructor should not allow for passing a `WebAssembly.Function` object in, in such situations a `TypeError` should be raised.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think throwing is not the right resolution here, see my latest comment on #13.

@wingo
Copy link
Contributor

wingo commented Sep 9, 2021

cc @Ms2ger

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants